﻿using System.Web.Mvc;

namespace MMSWebsite.Business
{
    public class MyAuthorize : AuthorizeAttribute
    {
        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            filterContext.Result = (new RedirectionErrorController()).RedirectionError();
        }

        private class RedirectionErrorController: Controller
        {
             public ActionResult RedirectionError()
             {
                 return View("AuthorizeError");
             }
        }
       
    }
}